<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input id="a" type="text">
    <br>
    <input id="b" type="text">
    <br>
    <input id="c" type="text">
    <br>
    <input id="d" type="text">
    <br>
    <input id="e" type="text">
    <div class="content"></div>

    <script src="./jq/jq.js"></script>
    <script>

        const state = {
            str: '',
        };

        Object.defineProperty(state, 'str', {
            set (newStr) {
                $('.content').text(newStr);
                $('input').val(newStr);
            }
        });

        // 数据驱动DOM
        $('input').on('input', function () {
            state.str = $(this).val();
        });

        setInterval(() => {
            state.str = Math.random();
        }, 1000);

    </script>
</body>
</html>